#include "ToolButtonLeftRightEntirety.hpp"
#include <QMouseEvent>
using namespace ribbonStyleControls::Controls;
ToolButtonLeftRigthEntirety::ToolButtonLeftRigthEntirety(QString name, QString iconPath, QWidget* parent)
	:ToolButtonLeftRight(name,iconPath,parent){}

QColor ToolButtonLeftRigthEntirety::upHover()
{
	if (isPressed) {
		//isPressed = false;
		return QColor(221, 226, 230);
	}
	return QColor(232, 235, 239);
}

QColor ToolButtonLeftRigthEntirety::downHover()
{
	if (isPressed) {
		//isPressed = false;
		return QColor(221, 226, 230);
	}
	return QColor(232, 235, 239);
}

QRect ToolButtonLeftRigthEntirety::fillClickRect()
{
	return rect();
}

void ToolButtonLeftRigthEntirety::mousePressEvent(QMouseEvent* event)
{
	if (rect().contains(event->pos())) {
		if (event->button() == Qt::LeftButton) {
			isPressed = true;
		}
	}

	ToolButtonBase::mousePressEvent(event);
}

void ToolButtonLeftRigthEntirety::mouseReleaseEvent(QMouseEvent* event)
{
	isPressed = false;
	ToolButtonBase::mouseReleaseEvent(event);
}

bool ToolButtonLeftRigthEntirety::upClickOpenMenu()
{
	return true;
}
bool ToolButtonLeftRigthEntirety::downClickOpenMenu()
{
	return true;
}